add getters to private properties, re: #148#150
add getters to private properties, re: #148#150tacman wants to merge 6 commits intozenstruck:1.xfrom
Conversation
|
Can you accept this PR, or give me some guidance on how to improve it? Thx. |
| public function setScreenshotDir(?string $screenshotDir): void | ||
| { | ||
| $this->screenshotDir = $screenshotDir; | ||
| } | ||
|
|
||
| public function setConsoleLogDir(?string $consoleLogDir): void | ||
| { | ||
| $this->consoleLogDir = $consoleLogDir; | ||
| } |
There was a problem hiding this comment.
I don't think we want to mutate these ones, WDYT @kbond?
| public function getScreenshotDir(): ?string | ||
| { | ||
| return $this->screenshotDir; | ||
| } | ||
|
|
||
| public function getConsoleLogDir(): ?string | ||
| { | ||
| return $this->consoleLogDir; | ||
| } |
There was a problem hiding this comment.
maybe i'ts time to bump php 8.1, and change these two properties to public readonly?
unfortunately, we can't do this for savedScreenshots / savedConsoleLogs... I really hope https://wiki.php.net/rfc/asymmetric-visibility-v2 will land in PHP some day 🤞
Co-authored-by: Nicolas PHILIPPE <nikophil@gmail.com>
|
@tacman, you can't use the I think it would be better to update HasBrowser::pantherBrowser() to accept these as options (I don't think the following works right now): $this->pantherBrowser(['screenshot_dir' => 'some/dir']);I'm really trying to keep the public api of browsers confined to just actions/assertions if possible. |
so the user can do something with the saved screenshots.